package com.itmk.web.comments.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.itmk.web.comments.entity.Comments;
import com.itmk.web.goods.entity.Goods;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommentsMapper  extends BaseMapper<Comments> {
    List<Comments> getCommentsByBuyerId(Long buyerId);


    // 查询某个订单是否已经评论
    @Select("SELECT COUNT(*) FROM comments WHERE order_id = #{orderId}")
    int countCommentsByOrderId(@Param("orderId") Integer orderId);

    List<Comments> getCommentsBySellerId(Long sellerId);


}
